home *** CD-ROM | disk | FTP | other *** search
/ My Neighborhood / My Neighborhood.iso / mac / MacFiles / DefProj.Dxr / 00011.ls < prev    next >
Encoding:
Text File  |  1997-11-18  |  1.8 KB  |  63 lines

  1. on startMovie
  2.   global ghardDiskPath, gCDRDrive, prefName
  3.   if the machineType <> 256 then
  4.     if the colorDepth <> 8 then
  5.       alert("Resetting your monitor's color depth to 256 colors.")
  6.       set the colorDepth to 8
  7.     end if
  8.     set ghardDiskPath to the pathName
  9.     set gCDRDrive to "My Neighborhood:Macfiles:"
  10.     set the exitLock to 1
  11.     go(1, gCDRDrive & "splash")
  12.   else
  13.     set prefName to the pathName & "MyNHood.PRF"
  14.   end if
  15. end
  16.  
  17. on testEntry
  18.   global gCDRDrive
  19.   delete char 2 to length(field "cd drive") of field "cd drive"
  20.   set temp to getfilenames()
  21.   if getOne(temp, "INTRO") = 0 then
  22.     alert("Can't find the CD-ROM files on drive " & field "cd drive" & ".  Please enter a new drive letter.")
  23.     go("drive")
  24.   else
  25.     set gCDRDrive to field "cd drive" & ":\PCFILES\"
  26.     saveDrive()
  27.     set the exitLock to 1
  28.     go(1, gCDRDrive & "splash")
  29.   end if
  30. end
  31.  
  32. on getfilenames
  33.   set fileList to []
  34.   set i to 1
  35.   set the itemDelimiter to "."
  36.   set n to getNthFileNameInFolder(field "cd drive" & ":\PCFILES\", 1)
  37.   repeat while n <> EMPTY
  38.     set n to item 1 of n
  39.     append(fileList, n)
  40.     set i to i + 1
  41.     set n to getNthFileNameInFolder(field "cd drive" & ":\PCFILES\", i)
  42.   end repeat
  43.   set the itemDelimiter to ","
  44.   return fileList
  45. end
  46.  
  47. on saveDrive
  48.   global prefName
  49.   set lineNum to 1
  50.   repeat while (lineNum <= the number of lines in field "preferences") and not (line lineNum of field "preferences" contains "Drive=")
  51.     set lineNum to lineNum + 1
  52.   end repeat
  53.   put numToChar(10) & "Drive=" into line lineNum of field "preferences"
  54.   put field "cd drive" after line lineNum of field "preferences"
  55.   set prefFile to FileIO(mnew, "write", prefName)
  56.   if not objectp(prefFile) then
  57.     alert("Error writing to file " & prefName)
  58.   else
  59.     prefFile(mWriteString, field "preferences")
  60.     prefFile(mdispose)
  61.   end if
  62. end
  63.